package com.wangtao.netty.InandoutHandler;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;


public class MyClientInit extends ChannelInitializer<SocketChannel>{

    @Override
    protected void initChannel(SocketChannel ch) throws Exception {
        ChannelPipeline pipeline = ch.pipeline();
        //这是出站的编码器
        pipeline.addLast(new MyLongToByteEncoder());
        //这是入站的解码器
        pipeline.addLast(new MyByteToLongDecoder());

        pipeline.addLast(new MyClientHanlder());

    }
}
